package game;

public enum Rank {
	UNDEFINED(0),ACE(1),TWO(2),THREE(3),FOUR(4),FIVE(5),SIX(6),SEVEN(7),EIGHT(8),NINE(9),TEN(10),JACK(11),QUEEN(12),KING(13);
	
	private final int value;
    private Rank(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }
    
    public static Rank intToRank(int i) {
    	switch (i) {
		case 0:
			return Rank.UNDEFINED;
		case 1:
			return Rank.ACE;
		case 2:
			return Rank.TWO;
		case 3:
			return Rank.THREE;
		case 4:
			return Rank.FOUR;
		case 5:
			return Rank.FIVE;
		case 6:
			return Rank.SIX;
		case 7:
			return Rank.SEVEN;
		case 8:
			return Rank.EIGHT;
		case 9:
			return Rank.NINE;
		case 10:
			return Rank.TEN;
		case 11:
			return Rank.JACK;
		case 12:
			return Rank.QUEEN;
		case 13:
			return Rank.KING;
		default:
			return null;
		}
    }
    public static String rankToString(int i) {
    	switch (i) {
		case 0:
			return "UNDEFINED";
		case 1:
			return "ACE";
		case 2:
			return "TWO";
		case 3:
			return "THREE";
		case 4:
			return "FOUR";
		case 5:
			return "FIVE";
		case 6:
			return "SIX";
		case 7:
			return "SEVEN";
		case 8:
			return "EIGHT";
		case 9:
			return "NINE";
		case 10:
			return "TEN";
		case 11:
			return "JACK";
		case 12:
			return "QUEEN";
		case 13:
			return "KING";
		default:
			return null;
		}
    }
}